/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author victor.silva
 */
@Entity
@Table(name = "curso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Curso.findAll", query = "SELECT c FROM Curso c"),
    @NamedQuery(name = "Curso.findByStrFnccampus", query = "SELECT c FROM Curso c WHERE c.strFnccampus = :strFnccampus"),
    @NamedQuery(name = "Curso.findByCrsCodigo", query = "SELECT c FROM Curso c WHERE c.crsCodigo = :crsCodigo"),
    @NamedQuery(name = "Curso.findByCrsDesricao", query = "SELECT c FROM Curso c WHERE c.crsDesricao = :crsDesricao"),
    @NamedQuery(name = "Curso.findByTrnDescricao", query = "SELECT c FROM Curso c WHERE c.trnDescricao = :trnDescricao"),
    @NamedQuery(name = "Curso.findByCrsDrcminima", query = "SELECT c FROM Curso c WHERE c.crsDrcminima = :crsDrcminima"),
    @NamedQuery(name = "Curso.findByCrsDrcmaxima", query = "SELECT c FROM Curso c WHERE c.crsDrcmaxima = :crsDrcmaxima"),
    @NamedQuery(name = "Curso.findByTblgrlltmCrscdgmodalidade", query = "SELECT c FROM Curso c WHERE c.tblgrlltmCrscdgmodalidade = :tblgrlltmCrscdgmodalidade")})
public class Curso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Size(max = 2147483647)
    @Column(name = "str_fnccampus")
    private String strFnccampus;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "crs_codigo")
    private String crsCodigo;
    @Size(max = 2147483647)
    @Column(name = "crs_desricao")
    private String crsDesricao;
    @Size(max = 2147483647)
    @Column(name = "trn_descricao")
    private String trnDescricao;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "crs_drcminima")
    private Double crsDrcminima;
    @Column(name = "crs_drcmaxima")
    private Double crsDrcmaxima;
    @Size(max = 2147483647)
    @Column(name = "tblgrlltm_crscdgmodalidade")
    private String tblgrlltmCrscdgmodalidade;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "curso")
    private List<CoordenadorCurso> coordenadorCursoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "curso")
    private List<Turma> turmaList;
    @JoinColumn(name = "str_colegiado", referencedColumnName = "str_codigo")
    @ManyToOne
    private Setor strColegiado;
    @JoinColumn(name = "str_responsavel", referencedColumnName = "str_codigo")
    @ManyToOne
    private Setor strResponsavel;

    public Curso() {
    }

    public Curso(String crsCodigo) {
        this.crsCodigo = crsCodigo;
    }

    public String getStrFnccampus() {
        return strFnccampus;
    }

    public void setStrFnccampus(String strFnccampus) {
        this.strFnccampus = strFnccampus;
    }

    public String getCrsCodigo() {
        return crsCodigo;
    }

    public void setCrsCodigo(String crsCodigo) {
        this.crsCodigo = crsCodigo;
    }

    public String getCrsDesricao() {
        return crsDesricao;
    }

    public void setCrsDesricao(String crsDesricao) {
        this.crsDesricao = crsDesricao;
    }

    public String getTrnDescricao() {
        return trnDescricao;
    }

    public void setTrnDescricao(String trnDescricao) {
        this.trnDescricao = trnDescricao;
    }

    public Double getCrsDrcminima() {
        return crsDrcminima;
    }

    public void setCrsDrcminima(Double crsDrcminima) {
        this.crsDrcminima = crsDrcminima;
    }

    public Double getCrsDrcmaxima() {
        return crsDrcmaxima;
    }

    public void setCrsDrcmaxima(Double crsDrcmaxima) {
        this.crsDrcmaxima = crsDrcmaxima;
    }

    public String getTblgrlltmCrscdgmodalidade() {
        return tblgrlltmCrscdgmodalidade;
    }

    public void setTblgrlltmCrscdgmodalidade(String tblgrlltmCrscdgmodalidade) {
        this.tblgrlltmCrscdgmodalidade = tblgrlltmCrscdgmodalidade;
    }

    @XmlTransient
    public List<CoordenadorCurso> getCoordenadorCursoList() {
        return coordenadorCursoList;
    }

    public void setCoordenadorCursoList(List<CoordenadorCurso> coordenadorCursoList) {
        this.coordenadorCursoList = coordenadorCursoList;
    }

    @XmlTransient
    public List<Turma> getTurmaList() {
        return turmaList;
    }

    public void setTurmaList(List<Turma> turmaList) {
        this.turmaList = turmaList;
    }

    public Setor getStrColegiado() {
        return strColegiado;
    }

    public void setStrColegiado(Setor strColegiado) {
        this.strColegiado = strColegiado;
    }

    public Setor getStrResponsavel() {
        return strResponsavel;
    }

    public void setStrResponsavel(Setor strResponsavel) {
        this.strResponsavel = strResponsavel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (crsCodigo != null ? crsCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Curso)) {
            return false;
        }
        Curso other = (Curso) object;
        if ((this.crsCodigo == null && other.crsCodigo != null) || (this.crsCodigo != null && !this.crsCodigo.equals(other.crsCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Curso[ crsCodigo=" + crsCodigo + " ]";
    }
    
}
